<?php
// $Id: index.php,v 0.0.1 2005/10/27 20:30:00 domifara Exp $
/**
 * $Id: index.php v 1.5 23 August 2004 hsalazar Exp $
 * Module: Soapbox
 * Version: v 1.5
 * Release Date: 23 August 2004
 * Author: hsalazar
 * Licence: GNU
 */

require( "admin_header.php" );
include_once XOOPS_ROOT_PATH."/modules/" . $xoopsModule->getVar("dirname") . "/class/admin.php" ;


$op = '';
if (isset($_GET['op'])) $op = trim(strip_tags( $myts->stripSlashesGPC($_GET['op']) ));
if (isset($_POST['op'])) $op = trim(strip_tags( $myts->stripSlashesGPC($_POST['op']) ));

$entries = isset($_POST['entries']) ? intval($_POST['entries']) : 0;

/* Available operations */
switch ($op)
	{
	case "default":
	default:
		include_once XOOPS_ROOT_PATH . '/class/pagenav.php';

		$startart = isset($_GET['startart']) ? intval($_GET['startart']) : 0;
		$startcol = isset($_GET['startcol']) ? intval($_GET['startcol']) : 0;
		$startsub = isset($_GET['startsub']) ? intval($_GET['startsub']) : 0;
		$datesub = isset($_GET['datesub']) ? intval($_GET['datesub']) : 0;

		xoops_cp_header();
		$index_admin = new ModuleAdmin() ;
		echo $index_admin->addNavigation('main.php') ;
		include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';
		include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/include/cleantags.php";
		$module_id = $xoopsModule->getVar('mid');

		//adminMenu(0, _AM_SB_INDEX);

		//echo "<h3 style='color: #2F5376; margin: 0 0 4px 0;'>"._AM_SB_MODCONTENT."</h3>";
		$today = sprintf(_AM_SB_IDXINTRO, formatTimestamp(time(), $xoopsModuleConfig['dateformat']));
		echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $myts->htmlSpecialChars($today) . "</span>";
		//get category count
		//----------------------------
		$_entrydata_handler =& xoops_getmodulehandler('entrydata',$xoopsModule->dirname());
		$totcol = $_entrydata_handler->getColumnCount();
		//----------------------------
		$criteria = new CriteriaCompo();
		$criteria->add(new Criteria( 'submit', 0 ) );
		$criteria->add(new Criteria( 'offline', 0 ) );
		$totpub = $_entrydata_handler->getArticleCount($criteria);
		unset($criteria);
		//----------------------------
		$criteria = new CriteriaCompo();
		$criteria->add(new Criteria( 'submit', 0 ) );
		$criteria->add(new Criteria( 'offline', 1 ) );
		$totoff = $_entrydata_handler->getArticleCount($criteria);
		unset($criteria);
		//----------------------------
		$criteria = new CriteriaCompo();
		$criteria->add(new Criteria( 'submit', 1 ) );
		$totsub = $_entrydata_handler->getArticleCount($criteria);
		unset($criteria);
		//----------------------------
		$criteria = new CriteriaCompo();
		$criteria->add(new Criteria( 'submit', 0 ) );
		$totall = $_entrydata_handler->getArticleCount($criteria);
		unset($criteria);
		//----------------------------
		echo "<table width='100%' class='outer' cellspacing='1' cellpadding='3' border='0' ><tr>";
		echo "<td class='head' width='20%'>"._AM_SB_TOTCOL."</td><td align='center' class='even'>".$totcol."</td>";
		echo "<td class='head' width='20%'>"._AM_SB_TOTART."</td><td align='center' class='even'>".$totpub."</td>";
		echo "<td class='head' width='20%'>"._AM_SB_TOTOFF."</td><td align='center' class='even'>".$totoff."</td>";
		echo "<td class='head' width='20%'>"._AM_SB_TOTSUB."</td><td align='center' class='even'>".$totsub."</td>";
		echo "</tr></table>";
		echo "<br /><br />";

		showArticles($xoopsModuleConfig['buttonsadmin']);
		showColumns($xoopsModuleConfig['buttonsadmin']);
	} 
include "footer.php";
//xoops_cp_footer();
?>
